home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 183 / dpcs0503.iso / Components / Microsoft ASP / _SETUP.1 / ASPComponents.jar / asp / nfx / MSDBNav / MSDBNav.class (.txt)
Encoding:
Java Class File  |  1998-11-20  |  15.5 KB  |  626 lines

  1. package asp.nfx.MSDBNav;
  2.  
  3. import asp.util.EResourceUtil;
  4. import asp.util.ResourceUtil;
  5. import com.netobjects.nfc.api.CStringArray;
  6. import com.netobjects.nfc.api.ComponentApp;
  7. import com.netobjects.nfc.api.DAssetManager;
  8. import com.netobjects.nfc.api.DDrawPicture;
  9. import com.netobjects.nfc.api.DImage;
  10. import com.netobjects.nfc.api.DLayout;
  11. import com.netobjects.nfc.api.DMessageBox;
  12. import com.netobjects.nfc.api.DRect;
  13. import com.netobjects.nfc.api.DSize;
  14. import com.netobjects.nfc.api.IDInspector;
  15.  
  16. public class MSDBNav extends ComponentApp {
  17.    String name;
  18.    String queryComponent;
  19.    int navigationType;
  20.    int numRecords;
  21.    int previousImage;
  22.    int nextImage;
  23.    int upImage;
  24.    int thisPage;
  25.    int upPage;
  26.    int keyFieldCount;
  27.    String[] keyFieldNames;
  28.    int[] keyFieldDataTypes;
  29.    private String INCLUDEFILE_SUBDIR = "asp";
  30.    String codebase;
  31.    DAssetManager assMan;
  32.    DDrawPicture cdp;
  33.    int defaultWidth;
  34.    int defaultHeight;
  35.    protected static transient ResourceUtil resUtil = null;
  36.    static final int MAXASSET = 50;
  37.    int[] assetControl;
  38.    int assetCount;
  39.    boolean published = false;
  40.    static final int MAXKEYFIELDCOUNT = 10;
  41.    static final int MAXFILTERFIELDCOUNT = 10;
  42.    static final int WIDTH_PAD = 20;
  43.    static final int HEIGHT_PAD = 4;
  44.    static final String SCRIPTDELIMOPEN = "<SCRIPT RUNAT=SERVER LANGUAGE=JSCRIPT>\n";
  45.    static final String SCRIPTDELIMCLOSE = "</SCRIPT>\n";
  46.    // $FF: synthetic field
  47.    static Class class$asp$nfx$MSDBNav$MSDBNav;
  48.  
  49.    public String onInstall(DAssetManager cam, String codebase) {
  50.       this.assMan = cam;
  51.       return "MSDBNav";
  52.    }
  53.  
  54.    public void onDrop(DLayout layout, DRect r, int fDrop) {
  55.       if (fDrop == 1) {
  56.          this.allocateFieldsArray();
  57.          this.name = resUtil.getString("value.name");
  58.          this.queryComponent = resUtil.getString("value.query");
  59.          this.navigationType = 0;
  60.          this.numRecords = 1;
  61.          this.thisPage = 0;
  62.          this.upPage = 0;
  63.          this.keyFieldCount = 0;
  64.          this.assetControl = new int[50];
  65.          this.cdp = new DDrawPicture();
  66.          this.codebase = this.cdp.getCodeBase();
  67.          int prevImageAsset = this.assMan.AddAsset(this.codebase + "PreviousButton.gif", "Image", "");
  68.          this.assetControl[this.assetCount] = prevImageAsset;
  69.          this.assMan.SetPublishAssetMode(this.assetControl[this.assetCount++], 453);
  70.          this.previousImage = prevImageAsset;
  71.          int nextImageAsset = this.assMan.AddAsset(this.codebase + "NextButton.gif", "Image", "");
  72.          this.assetControl[this.assetCount] = nextImageAsset;
  73.          this.assMan.SetPublishAssetMode(this.assetControl[this.assetCount++], 453);
  74.          this.nextImage = nextImageAsset;
  75.          int upImageAsset = this.assMan.AddAsset(this.codebase + "UpButton.gif", "Image", "");
  76.          this.assetControl[this.assetCount] = upImageAsset;
  77.          this.assMan.SetPublishAssetMode(this.assetControl[this.assetCount++], 453);
  78.          this.upImage = upImageAsset;
  79.          this.cdp.SetPositionRect(r.getLeft(), r.getTop(), r.getRight(), r.getBottom());
  80.          this.cdp.SetStyle(1, 1);
  81.          this.cdp.setStretch(2);
  82.          this.cdp.setImageFile(this.codebase + resUtil.getString("image.filename"));
  83.          this.resizeComponentDefault(this.cdp);
  84.          this.cdp.setPictureText("DBNavigator");
  85.          this.cdp.setUsePictureText(true);
  86.          layout.AddObject(this.cdp);
  87.       }
  88.    }
  89.  
  90.    public void onInspect(CStringArray Names, CStringArray Types) {
  91.       Names.Set(resUtil.getString("property.name"));
  92.       Types.Set("String");
  93.       Names.Set(resUtil.getString("property.query"));
  94.       Types.Set("String");
  95.       Names.Set(resUtil.getString("property.navtype"));
  96.       Types.Set("Set(" + resUtil.getString("option.navtype") + ")");
  97.       Names.Set(resUtil.getString("property.reccount"));
  98.       Types.Set("Collection");
  99.       Names.Set(resUtil.getString("property.previmage"));
  100.       Types.Set("Image");
  101.       Names.Set(resUtil.getString("property.nextimage"));
  102.       Types.Set("Image");
  103.       Names.Set(resUtil.getString("property.upimage"));
  104.       Types.Set("Image");
  105.       Names.Set(resUtil.getString("property.thispage"));
  106.       Types.Set("Link");
  107.       Names.Set(resUtil.getString("property.uppage"));
  108.       Types.Set("Link");
  109.       Names.Set(resUtil.getString("property.kfldcount"));
  110.       Types.Set("Collection");
  111.  
  112.       for(int cnt = 0; cnt < this.keyFieldCount; ++cnt) {
  113.          Names.Set(resUtil.getString("property.kfldname") + " " + Integer.toString(cnt + 1));
  114.          Types.Set("String");
  115.          Names.Set(resUtil.getString("property.kfldtype") + " " + Integer.toString(cnt + 1));
  116.          Types.Set("Set(" + resUtil.getString("option.kfldtype") + ")");
  117.       }
  118.  
  119.    }
  120.  
  121.    public String PropertyListener(String Event, String Value, int Get, int propIndex, IDInspector insp) {
  122.       if (Get == 1) {
  123.          if (Event.compareTo(resUtil.getString("property.name")) == 0) {
  124.             return this.name;
  125.          }
  126.  
  127.          if (Event.compareTo(resUtil.getString("property.query")) == 0) {
  128.             return this.queryComponent;
  129.          }
  130.  
  131.          if (Event.compareTo(resUtil.getString("property.navtype")) == 0) {
  132.             return Integer.toString(this.navigationType);
  133.          }
  134.  
  135.          if (Event.compareTo(resUtil.getString("property.reccount")) == 0) {
  136.             return Integer.toString(this.numRecords);
  137.          }
  138.  
  139.          if (Event.compareTo(resUtil.getString("property.previmage")) == 0) {
  140.             return Integer.toString(this.previousImage);
  141.          }
  142.  
  143.          if (Event.compareTo(resUtil.getString("property.nextimage")) == 0) {
  144.             return Integer.toString(this.nextImage);
  145.          }
  146.  
  147.          if (Event.compareTo(resUtil.getString("property.upimage")) == 0) {
  148.             return Integer.toString(this.upImage);
  149.          }
  150.  
  151.          if (Event.compareTo(resUtil.getString("property.thispage")) == 0) {
  152.             return Integer.toString(this.thisPage);
  153.          }
  154.  
  155.          if (Event.compareTo(resUtil.getString("property.uppage")) == 0) {
  156.             return Integer.toString(this.upPage);
  157.          }
  158.  
  159.          if (Event.compareTo(resUtil.getString("property.kfldcount")) == 0) {
  160.             return Integer.toString(this.keyFieldCount);
  161.          }
  162.  
  163.          for(int cnt = 0; cnt < this.keyFieldCount; ++cnt) {
  164.             if (Event.compareTo(resUtil.getString("property.kfldname") + " " + Integer.toString(cnt + 1)) == 0) {
  165.                return new String(this.keyFieldNames[cnt]);
  166.             }
  167.  
  168.             if (Event.compareTo(resUtil.getString("property.kfldtype") + " " + Integer.toString(cnt + 1)) == 0) {
  169.                return Integer.toString(this.keyFieldDataTypes[cnt]);
  170.             }
  171.          }
  172.       } else {
  173.          if (Event.compareTo(resUtil.getString("property.name")) == 0 && this.isValidName(Value)) {
  174.             this.name = Value;
  175.          }
  176.  
  177.          if (Event.compareTo(resUtil.getString("property.query")) == 0) {
  178.             if (this.isValidName(Value)) {
  179.                this.queryComponent = Value;
  180.             }
  181.          } else if (Event.compareTo(resUtil.getString("property.navtype")) == 0) {
  182.             this.navigationType = Integer.parseInt(Value, 10);
  183.          } else if (Event.compareTo(resUtil.getString("property.reccount")) == 0) {
  184.             if (this.isValidNumRecords(Integer.parseInt(Value, 10))) {
  185.                this.numRecords = Integer.parseInt(Value, 10);
  186.             }
  187.          } else if (Event.compareTo(resUtil.getString("property.previmage")) == 0) {
  188.             this.previousImage = Integer.parseInt(Value, 10);
  189.             this.resizeComponent();
  190.          } else if (Event.compareTo(resUtil.getString("property.nextimage")) == 0) {
  191.             this.nextImage = Integer.parseInt(Value, 10);
  192.             this.resizeComponent();
  193.          } else if (Event.compareTo(resUtil.getString("property.upimage")) == 0) {
  194.             this.upImage = Integer.parseInt(Value, 10);
  195.             this.resizeComponent();
  196.          } else if (Event.compareTo(resUtil.getString("property.thispage")) == 0) {
  197.             this.thisPage = Integer.parseInt(Value, 10);
  198.          } else if (Event.compareTo(resUtil.getString("property.uppage")) == 0) {
  199.             this.upPage = Integer.parseInt(Value, 10);
  200.          } else if (Event.compareTo(resUtil.getString("property.kfldcount")) == 0) {
  201.             int myCnt = Integer.parseInt(Value, 10);
  202.             if (this.isValidCollection(myCnt)) {
  203.                if (myCnt > 10) {
  204.                   myCnt = 10;
  205.                }
  206.  
  207.                this.keyFieldCount = myCnt;
  208.  
  209.                for(int cnt = this.keyFieldCount; cnt < 9; ++cnt) {
  210.                   this.keyFieldNames[cnt] = "";
  211.                   this.keyFieldDataTypes[cnt] = -1;
  212.                }
  213.             }
  214.          } else {
  215.             for(int cnt = 0; cnt < this.keyFieldCount; ++cnt) {
  216.                if (Event.compareTo(resUtil.getString("property.kfldname") + " " + Integer.toString(cnt + 1)) == 0) {
  217.                   this.keyFieldNames[cnt] = Value;
  218.                   insp.OnPropertyChanged(-1);
  219.                }
  220.  
  221.                if (Event.compareTo(resUtil.getString("property.kfldtype") + " " + Integer.toString(cnt + 1)) == 0) {
  222.                   this.keyFieldDataTypes[cnt] = Integer.parseInt(Value, 10);
  223.                }
  224.             }
  225.          }
  226.       }
  227.  
  228.       return "";
  229.    }
  230.  
  231.    public void onCopy() {
  232.       this.codebase = new String(this.codebase);
  233.       this.assMan.CopyAsset(this.thisPage);
  234.       this.assMan.CopyAsset(this.upPage);
  235.       int[] assetControlOld = this.assetControl;
  236.  
  237.       for(int i = 0; i < this.assetCount; ++i) {
  238.          this.assetControl[i] = assetControlOld[i];
  239.          if (this.assetControl[i] != 0) {
  240.             this.assMan.CopyAsset(this.assetControl[i]);
  241.          }
  242.       }
  243.  
  244.       String[] keyFieldNamesOld = this.keyFieldNames;
  245.       int[] keyFieldDataTypesOld = this.keyFieldDataTypes;
  246.       this.keyFieldNames = new String[10];
  247.       this.keyFieldDataTypes = new int[10];
  248.  
  249.       for(int cnt = 0; cnt < 10; ++cnt) {
  250.          this.keyFieldNames[cnt] = new String(keyFieldNamesOld[cnt]);
  251.          this.keyFieldDataTypes[cnt] = keyFieldDataTypesOld[cnt];
  252.       }
  253.  
  254.    }
  255.  
  256.    public void onPublish(DAssetManager asm, int context) {
  257.       this.removeAssets();
  258.       this.published = true;
  259.       int javaScriptAsset = this.assMan.AddAsset(this.codebase + "MSDBNav.inc", "JavaScript", "assets\\lib");
  260.       this.assetControl[this.assetCount] = javaScriptAsset;
  261.       this.assMan.SetPublishAssetMode(this.assetControl[this.assetCount++], 453);
  262.       DLayout cidLayout = this.cdp.getLayout();
  263.       int prevImageAsset = this.previousImage;
  264.       if (prevImageAsset == 0) {
  265.          prevImageAsset = this.assMan.AddAsset(this.codebase + "PreviousButton.gif", "Image", "");
  266.          this.assetControl[this.assetCount] = prevImageAsset;
  267.          this.assMan.SetPublishAssetMode(this.assetControl[this.assetCount++], 453);
  268.          this.previousImage = prevImageAsset;
  269.       }
  270.  
  271.       int nextImageAsset = this.nextImage;
  272.       if (nextImageAsset == 0) {
  273.          nextImageAsset = this.assMan.AddAsset(this.codebase + "NextButton.gif", "Image", "");
  274.          this.assetControl[this.assetCount] = nextImageAsset;
  275.          this.assMan.SetPublishAssetMode(this.assetControl[this.assetCount++], 453);
  276.          this.nextImage = nextImageAsset;
  277.       }
  278.  
  279.       int upImageAsset = this.upImage;
  280.       if (upImageAsset == 0) {
  281.          upImageAsset = this.assMan.AddAsset(this.codebase + "UpButton.gif", "Image", "");
  282.          this.assetControl[this.assetCount] = upImageAsset;
  283.          this.assMan.SetPublishAssetMode(this.assetControl[this.assetCount++], 453);
  284.          this.upImage = upImageAsset;
  285.       }
  286.  
  287.       String NestedDir = "";
  288.       String homePath = cidLayout.GetHomePath();
  289.       if (homePath.compareTo("..\\") == 0) {
  290.          NestedDir = ".";
  291.       }
  292.  
  293.       String IncludeFile = "<!--#INCLUDE FILE=\"" + NestedDir + "./assets/lib/MSDBNav.inc\"-->\n";
  294.       String prevImgPath = this.assMan.GetAssetRelativeLocation(prevImageAsset, context, 0);
  295.       String nextImgPath = this.assMan.GetAssetRelativeLocation(nextImageAsset, context, 0);
  296.       String upImgPath = this.assMan.GetAssetRelativeLocation(upImageAsset, context, 0);
  297.       String pagePath = this.assMan.GetAssetRelativeLocation(this.thisPage, context, 0);
  298.       String upPath = this.assMan.GetAssetRelativeLocation(this.upPage, context, 0);
  299.       String HTMLHead = "\r\n";
  300.       HTMLHead = HTMLHead + "<SCRIPT RUNAT=SERVER LANGUAGE=JSCRIPT>\n\r\n";
  301.       HTMLHead = HTMLHead + "//" + resUtil.getString("text.comment") + "\r\n";
  302.       HTMLHead = HTMLHead + "//" + resUtil.getString("text.commentfieldarray") + "\r\n";
  303.       HTMLHead = HTMLHead + this.name + "keyFieldNames = new Array(" + this.keyFieldCount + ");\r\n";
  304.       HTMLHead = HTMLHead + this.name + "keyFieldDataTypes = new Array(" + this.keyFieldCount + ");\r\n";
  305.       String isDetail = "true";
  306.       if (this.getNavigationType(this.navigationType).compareTo("list") == 0) {
  307.          isDetail = "false";
  308.       }
  309.  
  310.       for(int i = 0; i < this.keyFieldCount; ++i) {
  311.          HTMLHead = HTMLHead + this.name + "keyFieldNames[" + Integer.toString(i) + "] = \"" + this.keyFieldNames[i] + "\";\r\n";
  312.       }
  313.  
  314.       for(int var43 = 0; var43 < this.keyFieldCount; ++var43) {
  315.          HTMLHead = HTMLHead + this.name + "keyFieldDataTypes[" + Integer.toString(var43) + "] = \"" + this.getDataType(this.keyFieldDataTypes[var43]) + "\";\r\n";
  316.       }
  317.  
  318.       HTMLHead = HTMLHead + "\r\n";
  319.       HTMLHead = HTMLHead + "//Construct MSDBNav component\r\n";
  320.       HTMLHead = HTMLHead + this.name + " = new MSDBNav(\r\n";
  321.       HTMLHead = HTMLHead + "                \"" + this.name + "\",\n";
  322.       HTMLHead = HTMLHead + "                \"" + this.queryComponent + "\",\n";
  323.       HTMLHead = HTMLHead + "                \"" + prevImgPath + "\",\n";
  324.       HTMLHead = HTMLHead + "                \"" + nextImgPath + "\",\n";
  325.       HTMLHead = HTMLHead + "                \"" + upImgPath + "\",\n";
  326.       HTMLHead = HTMLHead + "                " + this.keyFieldCount + ",\n";
  327.       HTMLHead = HTMLHead + "                " + this.name + "keyFieldNames,\n";
  328.       HTMLHead = HTMLHead + "                " + this.name + "keyFieldDataTypes,\n";
  329.       HTMLHead = HTMLHead + "                \"" + pagePath + "\",\n";
  330.       HTMLHead = HTMLHead + "                \"" + upPath + "\",\n";
  331.       HTMLHead = HTMLHead + "                " + this.numRecords + ",\n";
  332.       HTMLHead = HTMLHead + "                " + isDetail + "\n";
  333.       HTMLHead = HTMLHead + ");\r\n";
  334.       HTMLHead = HTMLHead + "\r\n";
  335.       HTMLHead = HTMLHead + "</SCRIPT>\n\r\n";
  336.       cidLayout.setHTMLBefore(IncludeFile + HTMLHead);
  337.       String theHTML = "\r\n        <% ";
  338.       theHTML = theHTML + "        " + this.name + ".render()\n";
  339.       theHTML = theHTML + "        %>\n";
  340.       theHTML = theHTML + "        <!--\n        ";
  341.       this.cdp.setHTMLBefore(theHTML);
  342.       this.cdp.setHTMLAfter("\n        -->\n        ");
  343.    }
  344.  
  345.    protected void finalize() {
  346.       this.removeAssets();
  347.    }
  348.  
  349.    public void onUnInstall(DAssetManager cam) {
  350.    }
  351.  
  352.    private void removeAssets() {
  353.       if (this.published) {
  354.          for(int i = 0; i < this.assetCount; ++i) {
  355.             this.assMan.RemoveAsset(this.assetControl[i]);
  356.          }
  357.       }
  358.  
  359.       this.assetCount = 0;
  360.    }
  361.  
  362.    void allocateFieldsArray() {
  363.       this.keyFieldNames = new String[10];
  364.       this.keyFieldDataTypes = new int[10];
  365.  
  366.       for(int cnt = 0; cnt < 9; ++cnt) {
  367.          this.keyFieldNames[cnt] = "";
  368.          this.keyFieldDataTypes[cnt] = -1;
  369.       }
  370.  
  371.    }
  372.  
  373.    public boolean isValidName(String testString) {
  374.       boolean result = true;
  375.       if (testString.compareTo("") == 0) {
  376.          DMessageBox msg = new DMessageBox();
  377.          msg.Warning(resUtil.getString("error.validname"));
  378.          result = false;
  379.       }
  380.  
  381.       return result;
  382.    }
  383.  
  384.    public boolean isValidCollection(int testNo) {
  385.       boolean result = true;
  386.       if (testNo < 0) {
  387.          DMessageBox msg = new DMessageBox();
  388.          msg.Warning(resUtil.getString("error.validnumber"));
  389.          result = false;
  390.       }
  391.  
  392.       return result;
  393.    }
  394.  
  395.    public boolean isValidNumRecords(int testNo) {
  396.       boolean result = true;
  397.       if (testNo < 1) {
  398.          DMessageBox msg = new DMessageBox();
  399.          msg.Warning(resUtil.getString("error.validnon0number"));
  400.          result = false;
  401.       }
  402.  
  403.       return result;
  404.    }
  405.  
  406.    public String getBoolean(int myValue) {
  407.       return myValue == 0 ? "false" : "true";
  408.    }
  409.  
  410.    public String getNavigationType(int myValue) {
  411.       int maxCount = 2;
  412.       String result = "";
  413.       String[] myArray = new String[maxCount];
  414.       if (myValue >= 0 & myValue < maxCount) {
  415.          myArray[0] = "detail";
  416.          myArray[1] = "list";
  417.          result = myArray[myValue];
  418.       }
  419.  
  420.       return result;
  421.    }
  422.  
  423.    public String getDataType(int myValue) {
  424.       int maxCount = 4;
  425.       String result = "";
  426.       String[] myArray = new String[maxCount];
  427.       if (myValue >= 0 & myValue < maxCount) {
  428.          myArray[0] = "string";
  429.          myArray[1] = "number";
  430.          myArray[2] = "boolean";
  431.          myArray[3] = "date";
  432.          result = myArray[myValue];
  433.       }
  434.  
  435.       return result;
  436.    }
  437.  
  438.    private void resizeComponentDefault(DDrawPicture aPict) {
  439.       DImage imageSizer = new DImage();
  440.       imageSizer.setImageFile(aPict.getImageFile());
  441.       DSize imageSize = imageSizer.getSize();
  442.       aPict.SetSize(imageSize.getWidth(), imageSize.getHeight());
  443.       this.defaultWidth = imageSize.getWidth();
  444.       this.defaultHeight = imageSize.getHeight();
  445.    }
  446.  
  447.    private void resizeComponent() {
  448.       DImage imageSizer = new DImage();
  449.       int newWidth = 0;
  450.       int newHeight = 0;
  451.       if (this.previousImage > 0) {
  452.          String prevImgPath = this.assMan.GetAssetRelativeLocation(this.previousImage, 0, 1);
  453.          imageSizer.setImageFile(prevImgPath);
  454.          DSize imageSize = imageSizer.getSize();
  455.          newWidth += imageSize.getWidth();
  456.          if (newHeight < imageSize.getHeight()) {
  457.             newHeight = imageSize.getHeight();
  458.          }
  459.       }
  460.  
  461.       if (this.nextImage > 0) {
  462.          String nextImgPath = this.assMan.GetAssetRelativeLocation(this.nextImage, 0, 1);
  463.          imageSizer.setImageFile(nextImgPath);
  464.          DSize imageSize = imageSizer.getSize();
  465.          newWidth += imageSize.getWidth();
  466.          if (newHeight < imageSize.getHeight()) {
  467.             newHeight = imageSize.getHeight();
  468.          }
  469.       }
  470.  
  471.       if (this.upImage > 0) {
  472.          String upImgPath = this.assMan.GetAssetRelativeLocation(this.upImage, 0, 1);
  473.          imageSizer.setImageFile(upImgPath);
  474.          DSize imageSize = imageSizer.getSize();
  475.          newWidth += imageSize.getWidth();
  476.          if (newHeight < imageSize.getHeight()) {
  477.             newHeight = imageSize.getHeight();
  478.          }
  479.       }
  480.  
  481.       if (newWidth == 0) {
  482.          newWidth = this.defaultWidth;
  483.       }
  484.  
  485.       if (newHeight == 0) {
  486.          newHeight = this.defaultHeight;
  487.       }
  488.  
  489.       this.cdp.SetSize(newWidth + 20, newHeight + 20);
  490.    }
  491.  
  492.    public static ResourceUtil initResourceUtil(Class compClass) {
  493.       ResourceUtil _ru = null;
  494.  
  495.       try {
  496.          _ru = new ResourceUtil("asp.nfx.res", compClass);
  497.       } catch (EResourceUtil e) {
  498.          System.err.println(((Throwable)e).getMessage());
  499.       }
  500.  
  501.       return _ru;
  502.    }
  503.  
  504.    public String propertyManager(String Event, String Value, int Get) {
  505.       if (Get == 1) {
  506.          if (Event.compareTo(resUtil.getString("property.name")) == 0) {
  507.             return this.name;
  508.          }
  509.  
  510.          if (Event.compareTo(resUtil.getString("property.query")) == 0) {
  511.             return this.queryComponent;
  512.          }
  513.  
  514.          if (Event.compareTo(resUtil.getString("property.navtype")) == 0) {
  515.             return Integer.toString(this.navigationType);
  516.          }
  517.  
  518.          if (Event.compareTo(resUtil.getString("property.reccount")) == 0) {
  519.             return Integer.toString(this.numRecords);
  520.          }
  521.  
  522.          if (Event.compareTo(resUtil.getString("property.previmage")) == 0) {
  523.             return Integer.toString(this.previousImage);
  524.          }
  525.  
  526.          if (Event.compareTo(resUtil.getString("property.nextimage")) == 0) {
  527.             return Integer.toString(this.nextImage);
  528.          }
  529.  
  530.          if (Event.compareTo(resUtil.getString("property.upimage")) == 0) {
  531.             return Integer.toString(this.upImage);
  532.          }
  533.  
  534.          if (Event.compareTo(resUtil.getString("property.thispage")) == 0) {
  535.             return Integer.toString(this.thisPage);
  536.          }
  537.  
  538.          if (Event.compareTo(resUtil.getString("property.uppage")) == 0) {
  539.             return Integer.toString(this.upPage);
  540.          }
  541.  
  542.          if (Event.compareTo(resUtil.getString("property.kfldcount")) == 0) {
  543.             return Integer.toString(this.keyFieldCount);
  544.          }
  545.  
  546.          for(int cnt = 0; cnt < this.keyFieldCount; ++cnt) {
  547.             if (Event.compareTo(resUtil.getString("property.kfldname") + " " + Integer.toString(cnt + 1)) == 0) {
  548.                return new String(this.keyFieldNames[cnt]);
  549.             }
  550.  
  551.             if (Event.compareTo(resUtil.getString("property.kfldtype") + " " + Integer.toString(cnt + 1)) == 0) {
  552.                return Integer.toString(this.keyFieldDataTypes[cnt]);
  553.             }
  554.          }
  555.       } else {
  556.          if (Event.compareTo(resUtil.getString("property.name")) == 0 && this.isValidName(Value)) {
  557.             this.name = Value;
  558.          }
  559.  
  560.          if (Event.compareTo(resUtil.getString("property.query")) == 0) {
  561.             if (this.isValidName(Value)) {
  562.                this.queryComponent = Value;
  563.             }
  564.          } else if (Event.compareTo(resUtil.getString("property.navtype")) == 0) {
  565.             this.navigationType = Integer.parseInt(Value, 10);
  566.          } else if (Event.compareTo(resUtil.getString("property.reccount")) == 0) {
  567.             if (this.isValidNumRecords(Integer.parseInt(Value, 10))) {
  568.                this.numRecords = Integer.parseInt(Value, 10);
  569.             }
  570.          } else if (Event.compareTo(resUtil.getString("property.previmage")) == 0) {
  571.             this.previousImage = Integer.parseInt(Value, 10);
  572.             this.resizeComponent();
  573.          } else if (Event.compareTo(resUtil.getString("property.nextimage")) == 0) {
  574.             this.nextImage = Integer.parseInt(Value, 10);
  575.             this.resizeComponent();
  576.          } else if (Event.compareTo(resUtil.getString("property.upimage")) == 0) {
  577.             this.upImage = Integer.parseInt(Value, 10);
  578.             this.resizeComponent();
  579.          } else if (Event.compareTo(resUtil.getString("property.thispage")) == 0) {
  580.             this.thisPage = Integer.parseInt(Value, 10);
  581.          } else if (Event.compareTo(resUtil.getString("property.uppage")) == 0) {
  582.             this.upPage = Integer.parseInt(Value, 10);
  583.          } else if (Event.compareTo(resUtil.getString("property.kfldcount")) == 0) {
  584.             int myCnt = Integer.parseInt(Value, 10);
  585.             if (this.isValidCollection(myCnt)) {
  586.                if (myCnt > 10) {
  587.                   myCnt = 10;
  588.                }
  589.  
  590.                this.keyFieldCount = myCnt;
  591.  
  592.                for(int cnt = this.keyFieldCount; cnt < 9; ++cnt) {
  593.                   this.keyFieldNames[cnt] = "";
  594.                   this.keyFieldDataTypes[cnt] = -1;
  595.                }
  596.             }
  597.          } else {
  598.             for(int cnt = 0; cnt < this.keyFieldCount; ++cnt) {
  599.                if (Event.compareTo(resUtil.getString("property.kfldname") + " " + Integer.toString(cnt + 1)) == 0) {
  600.                   this.keyFieldNames[cnt] = Value;
  601.                }
  602.  
  603.                if (Event.compareTo(resUtil.getString("property.kfldtype") + " " + Integer.toString(cnt + 1)) == 0) {
  604.                   this.keyFieldDataTypes[cnt] = Integer.parseInt(Value, 10);
  605.                }
  606.             }
  607.          }
  608.       }
  609.  
  610.       return "";
  611.    }
  612.  
  613.    // $FF: synthetic method
  614.    static Class class$(String class$) {
  615.       try {
  616.          return Class.forName(class$);
  617.       } catch (ClassNotFoundException forName) {
  618.          throw new NoClassDefFoundError(((Throwable)forName).getMessage());
  619.       }
  620.    }
  621.  
  622.    static {
  623.       resUtil = initResourceUtil(class$asp$nfx$MSDBNav$MSDBNav != null ? class$asp$nfx$MSDBNav$MSDBNav : (class$asp$nfx$MSDBNav$MSDBNav = class$("asp.nfx.MSDBNav.MSDBNav")));
  624.    }
  625. }
  626.